import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:vape_xe/utils/utils.dart';
import 'package:vape_xe/widgets/widgets.dart';

import 'logic.dart';

class WithdrawAddressNewView extends GetView<WithdrawAddressNewController> {
  const WithdrawAddressNewView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios_new_rounded),
          onPressed: () => Get.back(),
        ),
        title: Text('Add new address'.tr),
      ),
      body: Column(
        mainAxisSize: MainAxisSize.max,
        children: [
          InnerContainerWidget(
            margin: EdgeInsets.symmetric(horizontal: 16.w),
            child: Row(
              children: [
                16.vGap,
                Image.asset(
                  Get.arguments['type'] == 3 ? 'assets/images/ic_duitnow.webp' : 'assets/images/ic_usdt.webp',
                  width: 28.w,
                  height: 28.w,
                ),
                12.vGap,
                Expanded(
                  child: TextField(
                    focusNode: controller.focusNode,
                    controller: controller.contentController,
                    decoration: const InputDecoration(border: InputBorder.none),
                    style: TextStyle(fontSize: 12.sp, fontFamily: 'Montserrat'),
                  ),
                ),
                12.vGap,
              ],
            ),
          ),
          16.hGap,
          GestureDetector(
            onTap: () => controller.addAddress(),
            child: Container(
              height: 52.h,
              margin: EdgeInsets.all(32.w),
              alignment: Alignment.center,
              decoration: BoxDecoration(
                borderRadius: 16.radius,
                gradient: const LinearGradient(colors: [Color(0xffF5B946), Color(0xffF58546)]),
              ),
              child: Text(
                'Confirm'.tr,
                style: TextStyle(
                  fontSize: 14.sp,
                  fontFamily: 'Montserrat',
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
          )
        ],
      ),
    );
  }
}
